# conding = utf-8
from pages.xgz.login import username, password, login_btn, login_tips, close_tips, deletebox, sbxea
from pages.page import Page


class LoginPage(Page):
    '''
    登录界面UI操作
    '''
    def username_deang(self):
        self.click(deletebox)

    def username_input(self, value):
        '''
        输入账户
        :param value:
        :return:
        '''
        self.send_keys(username, value)

    def password_input(self, value):
        '''
        输入密码
        :param value:
        :return:
        '''
        self.send_keys(password, value)

    def submit_login(self):
        '''
        单击登录提交按钮
        :return:
        '''
        self.click(login_btn)

    def tips_text(self):
        '''
        获取断言的文本
        :return:
        '''
        return self.text(login_tips)

    def close_tips(self):
        '''
        关闭提示框
        :return:
        '''
        self.click(close_tips)

    def index_url(self):
        '''
        登录成功的地址
        :return:
        '''
        return self.url()

    def sbxeae(self):
        self.click(sbxea)
